<template>
  <div class="blog-edit-context">
    <!-- 上方区域 -->
    <el-card class="handle-card">
      <div class="left">
        <el-select v-model="options.classes" placeholder="选择分类">
          <el-option
            v-for="item in classes"
            :key="item.value"
            :label="item.label"
            :value="item.value"
            clearable
          />
        </el-select>
        <el-select v-model="options.tags" placeholder="选择标签" multiple collapse-tags>
          <el-option
            v-for="item in tags"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
        <el-input
          v-model="options.title"
          placeholder="输入标题"
          clearable
        />
      </div>
      <div class="right">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="commit">提交文章</el-button>
      </div>
    </el-card>
    <el-card class="centent-card">
      <div slot="header">
        <span>文章内容</span>
      </div>
      <quill-editor
        ref="myQuillEditor"
        v-model="options.content"
        class="editor"
        :options="editorOption"
      />
    </el-card>
  </div>
</template>

<script>
// 导入富文本编辑器配置项
import editorOption from '@/utils/editor-option'
export default {
  components: {

  },
  props: {
    id: {
      type: [Number, String],
      default: ''
    }
  },
  data() {
    return {
      editorOption, // 富文本编辑器配置项
      options: {
        classes: '',
        tags: [],
        title: '',
        content: ''
      },
      classes: [{ value: 0, label: '科技' }, { value: 1, label: '娱乐' }],
      tags: [{ value: 0, label: '科技' }, { value: 1, label: '娱乐' }]
    }
  },
  computed: {

  },
  watch: {

  },
  created() {

  },
  mounted() {

  },
  methods: {
    commit() {
      console.log('提交')
    }
  }
}
</script>

<style scoped lang="scss">
@import '@/styles/editor.scss';
.blog-edit-context{
  height: 100%;
  display: flex;
  flex-direction:column;
  .handle-card{
    margin: 20px 0;
    height: 80px;
    ::v-deep .el-card__body{
    display: flex;
    justify-content: space-between;
    align-items: center;
    .left{
      display: flex;
      justify-content: space-between;
      .el-input{
        width: 150px;
        margin-right: 10px;
      }
    }
    }
  }
  .centent-card{
    height: 100%;
    display: flex;
    flex-direction: column;
    ::v-deep .el-card__body{
      flex: 1;
      overflow: hidden;
    }
  }
}
</style>
